<%@ page language="java" contentType="text/html; charset=utf-8"  pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>

<script type="text/javascript">
       
       var queryVo = ${queryVo};
       
       queryTotal.selectList("corpId",1);
       //queryTotal.selectList("deptId",2);
       queryTotal.selectList("operatorId",3);    
       
</script>

<div id="page-content" class="page-content">
		<div class="monitor">
			<form id="queryTotalForm">
				<div class="monitorLeft">
					<div class="form-group">
						<label class="col-sm-4 control-label">机构：</label>
						<div class="col-sm-7 ">
							<div class="pr">
								<select name="corpId" id="corpId"  class="form-control input-sm"></select>
							</div>
						</div>
					</div>
					
					<div class="form-group">
						<label class="col-sm-4 control-label">业务员：</label>
						<div class="col-sm-7 ">
							<div class="pr">
								<select name="operatorId" id="operatorId"  class="form-control input-sm"></select>
							</div>
						</div>
					</div>
					
					<div class="form-group">
						<label class="col-sm-4 control-label">查询类型：</label>
						<div class="col-sm-7 ">
							<div class="pr">
							    <!-- 1-个人查询，2-代理查询，3-司法查询 -->
								<select name="inquiryType" id="inquiryType" class="form-control input-sm">
								   <option value="">全部</option>
								  <option value="1" <c:if test="${queryVo.inquiryType==1}">selected</c:if>>个人查询</option>
                                  <option value="2" <c:if test="${queryVo.inquiryType==2}">selected</c:if>>代理查询</option>
                                  <option value="3" <c:if test="${queryVo.inquiryType==3}">selected</c:if>>司法查询</option>
								</select>
							</div>
						</div>
					</div>
					
					<div class="form-group dateContainer">
						<label class="col-sm-4 control-label">开始时间：</label>
						<div class="col-sm-7 ">
							<div class="pr">
								<input id="beginTime" name="beginTime" value="<fmt:formatDate value='${queryVo.beginTime }' pattern='yyyy-MM-dd' />" class="form-control datepicker" type="text" onclick="WdatePicker({maxDate:'#F{$dp.$D(\'endTime\')||\'5020-01-01\'}'})"/>							
							</div>
						</div>
					</div>
					
					<div class="form-group dateContainer">
						<label class="col-sm-4 control-label">结束时间：</label>
						<div class="col-sm-7 ">
							<div class="pr">
                                  <input id="endTime" name="endTime" value="<fmt:formatDate value='${queryVo.endTime }' pattern='yyyy-MM-dd' />" class="form-control datepicker" type="text" onclick="WdatePicker({minDate:'#F{$dp.$D(\'beginTime\')}',maxDate:'5020-10-01'})"/>
							</div>
						</div>
					</div>	
					<div class="form-group">
						<label class="col-sm-4 control-label">查询结果：</label>
						<div class="col-sm-7 ">
							<div class="pr">
								<select name="status" id="status" class="form-control input-sm">
								  <option value="">全部</option>
								  <option value="1" <c:if test="${queryVo.status==1}">selected</c:if>>成功</option>
								  <option value="2" <c:if test="${queryVo.status==2}">selected</c:if>>失败</option>
								</select>
							</div>
						</div>
					</div>

				</div>
	
				<!-- log.searchLoginLog() 定义在work.js的文件里面 -->
				<div class="monitorRight">
					<a href="javascript:void(0);" class="btnSearch"
						onclick="queryTotal.pageList();">查询</a> 
				    <a href="javascript:void(0);" onclick="queryTotal.exportlist();" class="btnSearch">导出</a> 
				</div>

			</form>
		</div>
		<div class="clearfix"></div>

		<div class="portlet-body">
			<div class="table-scrollable">
				<table class="table table-condensed flip-content">
					<thead class="flip-content">
						<tr>
						    <th width="8%">机构名称</th>	
						    <th width="8%">业务员</th>	
						    <th width="8%">查询类型</th>					
							<th width="10%">查询用户</th>
							<th width="10%">用户证件</th>
							<th width="10%">证件号码</th>
							<th width="10%">查询结果</th>
							<th width="12%">查询时间</th>
							<th width="6%">是否收费</th>
							<th width="10%">收费金额</th>
							<!-- 统计结果列表内容包括机构、部门、业务员名称、用户名、成功/失败、总数、成功比例、详细情况、合计 -->
						</tr>
					</thead>
					<tbody id="select_tbody">
					   <c:if test="${result.code eq 'SUCCESS' }">
					     <c:forEach items="${result.data.rows}" var ="row" varStatus="status">
						     <tr>
								<td width="8%" class="">${row.corpName }</td>	
								<td width="8%" class="">${row.operatorAccount }</td>
								<td width="8%" class="">${row.inquiryTypeDesc }</td>							
								<td width="10%" class="">${row.userName }</td>
								<td width="10%" class="">${row.cardName }</td>
								<td width="10%" class="">${row.cardNum }</td>
								<td width="10%" class="">
								   <c:choose>
								     <c:when test="${row.status == 0 }">未审批</c:when>
								     <c:when test="${row.status == 1 }">已审批</c:when>
								     <c:when test="${row.status == 2 }">成功</c:when>
								     <c:when test="${row.status == 4 }">审批未通过</c:when>
								     <c:otherwise>查询失败</c:otherwise>
								   </c:choose>
								</td>
								<td width="12%" class=""><fmt:formatDate value="${row.createTime }" pattern="yyyy-MM-dd HH:mm:ss" /></td>
								<td width="6%" class="">
								   <c:if test="${row.isCharge eq 1 }">是</c:if>
								   <c:if test="${row.isCharge ne 1 }">否</c:if>
								</td>
								<td width="10%" class="">
								 <c:if test="${row.isCharge eq 1 }">￥<fmt:formatNumber value="${row.feeAmount }" type="currency" pattern=".00"/>元</c:if>
								 <c:if test="${row.isCharge ne 1 }">----</c:if>
								</td>
							</tr>
					    </c:forEach>
					   </c:if>
		
					</tbody>
				</table>
			</div>
		</div>
</div>

<c:if test="${result.code eq 'SUCCESS' }">
  
  <script type="text/javascript">

    Page.navigation('page', 'report/query/page/list/view', 'page:page', '${result.data.pageSize}', '${result.data.total}', '${result.data.pageCount}', '${result.data.currPage}', 'menuUrl');

  </script>
  
  <div id="page" class="page"> </div>

</c:if>

